var form = layui.form
$(".layui-form").on("submit", function (e) {
    e.preventDefault();
    let data = $(this).serialize();
    $.ajax({
        type: "post",
        url: "api/login",
        data: data,
        success: function (res) {
            console.log(res);
            layer.msg(res.message)
            if (res.status === 0) {
                localStorage.setItem("mytoken", res.token)
                location.href = "./index.html"
            }
        }
    })
})